package com.springboot2.validate.annotation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 自定义日期验证
 */
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})
@Retention(RUNTIME)
@Constraint(validatedBy = DateTimeValidator.class)
public @interface DateTime {

    /**
     * 提示消息
     * @return
     */
    String message() default "";

    /**
     * 时间日期格式
     * @return
     */
    String formatter() default "";

    Class<?>[] groups() default {} ;

    Class<? extends Payload>[] payload() default {};
}
